Skip to content

fix: add allowed extensions props on formik input component#913

Open
tomrndom wants to merge 4 commits into
masterfrom
fix/page-module-download-extensions
Open

fix: add allowed extensions props on formik input component#913
tomrndom wants to merge 4 commits into
masterfrom
fix/page-module-download-extensions

Conversation

@tomrndom
Copy link
Copy Markdown

@tomrndom tomrndom commented May 5, 2026

ref: https://app.clickup.com/t/86b9c38wj

image image

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

  • New Features

    • File upload now supports configurable allowed file extensions.
    • Document upload accepts PDFs in addition to supported image formats.
  • Tests

    • Upload-related tests updated to reflect the refactored upload component import.
  • Chores

    • Internal dependency for the upload component adjusted (maintenance update).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 918a9a92-8e53-4cd9-acf1-e20396afc6fa

📥 Commits

Reviewing files that changed from the base of the PR and between 595e3c6 and 654ddf1.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json
✅ Files skipped from review due to trivial changes (1)
  • package.json

📝 Walkthrough

Walkthrough

Adds an optional allowedExtensions prop to MuiFormikUpload (falls back to ALLOWED_INVENTORY_IMAGE_FORMATS), passes ["pdf", ...ALLOWED_INVENTORY_IMAGE_FORMATS] from a document module, updates a test mock path to the external package, and updates the openstack-uicore-foundation dependency version.

Changes

MuiFormikUpload allowedExtensions

Layer / File(s) Summary
PropTypes / Public API
src/components/mui/formik-inputs/mui-formik-upload.js
MuiFormikUpload.propTypes declares allowedExtensions as an array of strings and maxFiles as a number.
Component Implementation
src/components/mui/formik-inputs/mui-formik-upload.js
MuiFormikUpload destructures allowedExtensions prop and applies it to mediaType.type.allowed_extensions, falling back to ALLOWED_INVENTORY_IMAGE_FORMATS.
Integration / Usage
src/pages/sponsors-global/page-templates/page-template-popup/modules/page-template-document-download-module.js
DocumentDownloadModule imports MuiFormikUpload and ALLOWED_INVENTORY_IMAGE_FORMATS, then passes allowedExtensions = ["pdf", ...ALLOWED_INVENTORY_IMAGE_FORMATS].
Tests / Mocks
src/pages/sponsors-global/page-templates/page-template-popup/page-template-module-form.test.js
Jest mock target path for the upload component is updated to openstack-uicore-foundation/lib/components/mui/formik-inputs/upload while keeping the same mock implementation.
Dependency manifest
package.json
openstack-uicore-foundation dependency version updated in dependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • smarcet

Poem

🐰 I hopped through props with ears held high,

Allowed extensions now pass on by.
PDF joins images in a tidy row,
Uploads accept what callers show.
A small carrot cheer for files that go!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically describes the main change: adding an allowedExtensions prop to the formik upload component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/page-module-download-extensions

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@tomrndom tomrndom requested review from smarcet and removed request for smarcet May 6, 2026 12:57
@tomrndom
Copy link
Copy Markdown
Author

tomrndom commented May 7, 2026

@smarcet waiting changes from OpenStackweb/openstack-uicore-foundation#236 to update uicore version

tomrndom added 3 commits May 8, 2026 12:28
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@tomrndom tomrndom force-pushed the fix/page-module-download-extensions branch from b2683d5 to 595e3c6 Compare May 8, 2026 15:29
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant